package sealte.database.monitor.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Properties;

import sealte.util.database.conn.DBINFOReader;

public class DBConnection2 {
	
	private static Connection conn = null;
	private static Properties props = null;
	
	static{
		try {
			Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
			props = new Properties();
			props.put("user", "classiccars");
			props.put("password", "classiccars");
			conn = DriverManager.getConnection("jdbc:derby://localhost:1527/myeclipse;create=false",props);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	private DBConnection2(){}
	
	public static Connection getConnection(){
		return conn;
	}
	
	public static void close(ResultSet rs,PreparedStatement ps,Connection conn){
		DBINFOReader.close(rs, ps, conn);
	}
}
